typedef struct Component {
    void (*operation)(void);
    // 其他成员...
} Component;

void component_operation(void) {
    printf("Component operation\n");
}

Component* create_component() {
    Component *comp = malloc(sizeof(Component));
    comp->operation = component_operation;
    return comp;
}